package com.example.menuvirtualclient.presenter;

import com.example.menuvirtualclient.rule.OrderRule;
import com.example.menuvirtualclient.view.IOrderView;

public class OrderPresenter {

	private IOrderView _view;
	private OrderRule _rule;
	
	/**
	 * 
	 * @param view
	 */
	public OrderPresenter(IOrderView view){
		_view = view;
		_rule = new OrderRule(view.GetContext());
	}
	
	/**
	 * 
	 */
	public void SendOrder(){
		try{
			
		}
		catch(Exception ex){
			HandleException(ex.getMessage());
		}
	}
	
	/**
	 * 
	 */
	public void GetMyOrder(String table){
		try{
			_rule.GetEntity(table);
		}
		catch(Exception ex){
			HandleException(ex.getMessage());
		}
	}
	
	/**
	 * 
	 * @param title
	 * @param message
	 */
	private void HandleException(String title, String message){
		_view.SetMessage(title, message);
	}
	/**
	 * 
	 * @param message
	 */
	private void HandleException(String message){
		HandleException("Error", message);
	}
}
